<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
      xmlns:contact="http://www.contact.contact.com/contacts/contact/ui"
      xmlns:a4j="http://richfaces.org/a4j"
        >

<ui:component>
    <!--@elvariable id="bean" type="rs.contacts.contact.ui.request.ActionContactBean"-->
    <!--@elvariable id="id" type="java.lang.String"-->
     <!--@elvariable id="canEdit" type="java.lang.Boolean"-->
    <h:panelGroup layout="block" style="width:300px">
        <h:outputLabel value="Telephone And Mail"/>
        <rich:separator height="2px" width="100%"/>
        <h:panelGroup rendered="#{canEdit}" layout="block" style="float:right;">
            <a4j:commandButton rendered="#{not empty bean.telephonesAndMails}"
                               value="Edit"
                               action="#{bean.prepareEditTelepAndMail}"
                               limitToList="true"
                               reRender="contactModalPanel"
                               oncomplete="Richfaces.showModalPanel('contactModalPanel');"/>
            <a4j:commandButton rendered="#{empty bean.telephonesAndMails}"
                               value="Add"
                               action="#{bean.prepareEditTelepAndMail}"
                               reRender="contactModalPanel"
                               oncomplete="Richfaces.showModalPanel('contactModalPanel');"
                               limitToList="true"/>
        </h:panelGroup>

        <h:panelGroup rendered="#{empty bean.telephonesAndMails}" layout="block" style="width:100%;text-align:center;">
            <br/>
            <h:outputLabel value="[Contact Information is Empty]"/>
        </h:panelGroup>
    </h:panelGroup>


    <h:panelGroup layout="block" style="width:250px">
        <h:panelGroup rendered="#{not empty bean.telephonesAndMails}">
            <h:panelGroup layout="block">
                <rich:dataTable id="#{id}Table" style="width:100%; background:inherit;" value="#{bean.telephonesAndMails}" var="data">
                    <rich:column>
                        <h:outputText value="#{data.name}"/>
                    </rich:column>
                    <rich:column>

                        <h:outputText value="#{data.data}"/>
                    </rich:column>

                </rich:dataTable>


            </h:panelGroup>

        </h:panelGroup>
    </h:panelGroup>


</ui:component>


</html>


